* Manuscript Title: With Age Comes Wisdom: Campaign Duration and the Countervailing Effects of Participant Diversity
* Latest Update: 2025-11-02
* Data: finaldata_CampaignDiversity
* Analysis run using Stata 16.1

*===============================================================================
* Tables and Figures in the main text
*===============================================================================

*===============================================================================
*  Table 1: Countervailing Effects of Diversity
*===============================================================================
est clear
** internal conflict (binary)
eststo: logit bi_internal_confl c.divsum i.prim_meth c.lntotal_part i.sec_defect  c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur c.csorepress c.v2cacamps_ord c.v2pepwrses_ord, vce(robust)

margins, dydx(divsum)

** progress (binary)
eststo: logit bi_progress c.divsum i.prim_meth c.lntotal_part i.sec_defect  c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur c.csorepress c.v2cacamps_ord c.v2pepwrses_ord, vce(robust)

margins, dydx(divsum)
margins, at(divsum=(0 (1) 9))

** success
eststo: logit success c.divsum i.prim_meth c.lntotal_part i.sec_defect  c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur c.csorepress c.v2cacamps_ord c.v2pepwrses_ord, vce(robust)

margins, dydx(divsum)
margins, at(divsum=(0 (1) 9))

esttab using "./final_model/main_divsum.tex", unstack scalars(N chi2 p ll) ///
 replace  ///
 b(3) se(3) nomtitle label star(* 0.10 ** 0.05 *** 0.01) ///
 booktabs  ///
 title("Logistic regression results")

*===============================================================================
* Table 2: Internal conflict (binary) as a predictor of campaign failure
*===============================================================================
** BINARY
** progress (binary)
est clear 

eststo: logit bi_progress bi_internal_confl c.divsum i.prim_meth c.lntotal_part i.sec_defect  c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur c.csorepress c.v2cacamps_ord c.v2pepwrses_ord, vce(robust)

** success
eststo: logit success bi_internal_confl c.divsum i.prim_meth c.lntotal_part i.sec_defect  c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur c.csorepress c.v2cacamps_ord c.v2pepwrses_ord, vce(robust)

margins, dydx(bi_internal_confl)
margins, at(bi_internal_confl=(0 1))

margins, at(divsum=(0 (1) 9))

esttab using "./final_model/internalcofl_iv.tex", unstack scalars(N chi2 p ll) ///
 replace  ///
 b(3) se(3) nomtitle label star(* 0.10 ** 0.05 *** 0.01) ///
 booktabs  ///
 title("Logistic regression results")

*===============================================================================
* Table 3: Interaction effects of diversity and campaign age on internal conflict and campaign success
*===============================================================================
est clear

eststo: logit bi_internal_confl c.divsum##c.camp_age i.prim_meth c.lntotal_part i.sec_defect  c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur c.csorepress c.v2cacamps_ord c.v2pepwrses_ord, vce(robust)

* Figure 1: Interaction effects of diversity and campaign age on internal conflict

* Estimate margins separately by camp_age
margins, at(divsum=(0(1)9) camp_age=2)
marginsplot, name(mg2, replace) title("camp_age = 2") ytitle(Pr(Internal conflict)) xtitle(Sum of diversity)

margins, at(divsum=(0(1)9) camp_age=6)
marginsplot, name(mg6, replace) title("camp_age = 6") ytitle(Pr(Internal conflict)) xtitle(Sum of diversity)

margins, at(divsum=(0(1)9) camp_age=14)
marginsplot, name(mg14, replace) title("camp_age = 14") ytitle(Pr(Internal conflict)) xtitle(Sum of diversity)

* Combine all three into one panel
graph combine mg2 mg6 mg14, col(3) title("Predictive Margins by Camp Age")

** success
eststo: logit success c.divsum##c.camp_age i.prim_meth c.lntotal_part i.sec_defect  c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur c.csorepress c.v2cacamps_ord c.v2pepwrses_ord, vce(robust)

esttab using "./final_model/inter_campage_cont.tex", unstack scalars(N chi2 p ll) ///
 replace  ///
 b(3) se(3) nomtitle label star(* 0.10 ** 0.05 *** 0.01) ///
 booktabs  ///
 title("Interaction effects of diversity and campaign age on success")

* Figure 2: Interaction effects of diversity and campaign age on campaign success

* Estimate margins separately by camp_age
margins, at(divsum=(0(1)9) camp_age=2)
marginsplot, name(mg2, replace) title("camp_age = 2") ytitle(Pr(Success)) xtitle(Sum of diversity)

margins, at(divsum=(0(1)9) camp_age=6)
marginsplot, name(mg6, replace) title("camp_age = 6") ytitle(Pr(Success)) xtitle(Sum of diversity)

margins, at(divsum=(0(1)9) camp_age=14)
marginsplot, name(mg14, replace) title("camp_age = 14") ytitle(Pr(Success)) xtitle(Sum of diversity)

* Combine all three into one panel
graph combine mg2 mg6 mg14, col(3) title("Predictive Margins by Camp Age")


*===============================================================================
* Appendix
*===============================================================================

*===============================================================================
* Table A1: Descriptive statistics
*===============================================================================
est clear
sum success bi_progress bi_internal_confl camp_confl_intensity_tri divsum camp_age prim_meth lntotal_part sec_defect  v2x_regime3 lngdppc lnpop ln_regdur csorepress v2cacamps_ord v2pepwrses_ord

estpost summarize success bi_progress bi_internal_confl camp_confl_intensity_tri divsum camp_age prim_meth lntotal_part sec_defect  v2x_regime3 lngdppc lnpop ln_regdur csorepress v2cacamps_ord v2pepwrses_ord, detail
esttab using desc_table.tex, ///
    cells("count(fmt(%9.0g)) mean(fmt(%9.3f)) sd(fmt(%9.3f)) min(fmt(%9.3f)) max(fmt(%9.3f))") ///
    label nomtitle nonumber noobs ///
    booktabs ///
    replace ///
    title("Descriptive Statistics") ///
    alignment(D{.}{.}{-1}) ///
    collabels("N" "Mean" "Std. Dev." "Min" "Max") ///
    fragment

	
*===============================================================================
* Table A2: Curvlinear effect of campaign age on internal conflict and success
*===============================================================================
est clear
** without interaction 
eststo: logit bi_internal_confl c.divsum c.camp_age##c.camp_age i.prim_meth c.lntotal_part i.sec_defect  c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur c.csorepress c.v2cacamps_ord c.v2pepwrses_ord, vce(robust)

* Figure 3
margins, at(camp_age = (0 (1) 65))

marginsplot

eststo: logit success c.divsum c.camp_age##c.camp_age i.prim_meth c.lntotal_part i.sec_defect  c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur c.csorepress c.v2cacamps_ord c.v2pepwrses_ord, vce(robust)

* Figure 4
margins, at(camp_age = (0 (1) 65))

marginsplot


esttab using "./final_model/age-squared.tex", unstack scalars(N chi2 p ll) ///
 replace  ///
 b(3) se(3) nomtitle label star(* 0.10 ** 0.05 *** 0.01) ///
 booktabs  ///
 title("Curvlinear effect of campaign age on internal conflict and success")
	
*===============================================================================
* Table A3: Interaction effects of diversity and campaign age on internal conflict and success (Without outliers – campaigns older than 30 years)
*===============================================================================
est clear

eststo: logit bi_internal_confl c.divsum##c.camp_age i.prim_meth c.lntotal_part i.sec_defect  c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur c.csorepress c.v2cacamps_ord c.v2pepwrses_ord if camp_age < 30, vce(robust)

esttab using "./final_model/dv_intcofl_inter_wo3y.tex", unstack scalars(N chi2 p ll) ///
 replace  ///
 b(3) se(3) nomtitle label star(* 0.10 ** 0.05 *** 0.01) ///
 booktabs  ///
 title("Interaction effect of diversity and campaign age on the internal conflict (Without campaigns older than 30 years)")

 
* Figure 5: Estimate margins separately by camp_age
margins, at(divsum=(0(1)9) camp_age=2)
marginsplot, name(mg2, replace) title("camp_age = 2") ytitle(Pr(Internal conflict)) xtitle(Sum of diversity)

margins, at(divsum=(0(1)9) camp_age=6)
marginsplot, name(mg6, replace) title("camp_age = 6") ytitle(Pr(Internal conflict)) xtitle(Sum of diversity)

margins, at(divsum=(0(1)9) camp_age=14)
marginsplot, name(mg14, replace) title("camp_age = 14") ytitle(Pr(Internal conflict)) xtitle(Sum of diversity)

* Combine all three into one panel
graph combine mg2 mg6 mg14, col(3) title("Predictive Margins by Camp Age")

** success
eststo: logit success c.divsum##c.camp_age i.prim_meth c.lntotal_part i.sec_defect  c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur c.csorepress c.v2cacamps_ord c.v2pepwrses_ord if camp_age < 30, vce(robust)

esttab using "./final_model/inter_campage_cont_wo30y.tex", unstack scalars(N chi2 p ll) ///
 replace  ///
 b(3) se(3) nomtitle label star(* 0.10 ** 0.05 *** 0.01) ///
 booktabs  ///
 title("Interaction effects of diversity and campaign age on success (Without campaigns older than 30 years)")


* Figure 6: Estimate margins separately by camp_age
margins, at(divsum=(0(1)9) camp_age=2)
marginsplot, name(mg2, replace) title("camp_age = 2") ytitle(Pr(Success)) xtitle(Sum of diversity)

margins, at(divsum=(0(1)9) camp_age=6)
marginsplot, name(mg6, replace) title("camp_age = 6") ytitle(Pr(Success)) xtitle(Sum of diversity)

margins, at(divsum=(0(1)9) camp_age=14)
marginsplot, name(mg14, replace) title("camp_age = 14") ytitle(Pr(Success)) xtitle(Sum of diversity)

* Combine all three into one panel
graph combine mg2 mg6 mg14, col(3) title("Predictive Margins by Camp Age")

*===============================================================================
* Table A4: Interaction effects of diversity and age-squared
*===============================================================================
 
est clear

eststo: logit bi_internal_confl ///
    c.divsum##c.camp_age##c.camp_age ///
    i.prim_meth c.lntotal_part i.sec_defect ///
    c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur ///
    c.csorepress c.v2cacamps_ord c.v2pepwrses_ord, vce(robust)

eststo: logit success ///
    c.divsum##c.camp_age##c.camp_age ///
    i.prim_meth c.lntotal_part i.sec_defect ///
    c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur ///
    c.csorepress c.v2cacamps_ord c.v2pepwrses_ord, vce(robust)
	

esttab using "./agesq_diversity.tex", unstack scalars(N chi2 p ll) ///
 replace  ///
 b(3) se(3) nomtitle label star(* 0.10 ** 0.05 *** 0.01) ///
 booktabs  ///
 title("Interaction effects of diversity and age-squared")
 

* Figure 7 (top-panel): Estimate margins separately by camp_age
margins, at(divsum=(0(1)9) camp_age=2)
marginsplot, name(mg2, replace) title("camp_age = 2") ytitle(Pr(Success)) xtitle(Sum of diversity)

margins, at(divsum=(0(1)9) camp_age=6)
marginsplot, name(mg6, replace) title("camp_age = 6") ytitle(Pr(Success)) xtitle(Sum of diversity)

margins, at(divsum=(0(1)9) camp_age=14)
marginsplot, name(mg14, replace) title("camp_age = 14") ytitle(Pr(Success)) xtitle(Sum of diversity)

* Combine all three into one panel
graph combine mg2 mg6 mg14, col(3) title("Predictive Margins by Camp Age")


* Figure 7 (bottom-panel): Estimate margins separately by camp_age
margins, at(divsum=(0(1)9) camp_age=20)
marginsplot, name(mg20, replace) title("camp_age = 20") ytitle(Pr(Success)) xtitle(Sum of diversity)

margins, at(divsum=(0(1)9) camp_age=30)
marginsplot, name(mg30, replace) title("camp_age = 30") ytitle(Pr(Success)) xtitle(Sum of diversity)

margins, at(divsum=(0(1)9) camp_age=40)
marginsplot, name(mg40, replace) title("camp_age = 40") ytitle(Pr(Success)) xtitle(Sum of diversity)

* Combine all three into one panel
graph combine mg20 mg30 mg40, col(3) title("Predictive Margins by Camp Age")


* Figure 8: visualize margins plot
margins, dydx(divsum) at(camp_age=(0(1)40))
marginsplot, name(mplot, replace) ///
    yline(0, lpattern(dash) lcolor(gs12))

 
*===============================================================================    
* Table A5: Excluding smaller campaigns (less than 1,000 participants)
*===============================================================================
* camp_size > 0
est clear

eststo: logit bi_internal_confl c.divsum##c.camp_age i.prim_meth c.lntotal_part i.sec_defect  c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur c.csorepress c.v2cacamps_ord c.v2pepwrses_ord if camp_size > 0, vce(robust)

eststo: logit success c.divsum##c.camp_age i.prim_meth c.lntotal_part i.sec_defect  c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur c.csorepress c.v2cacamps_ord c.v2pepwrses_ord if camp_size > 0, vce(robust)

esttab using "./subset_over1000.tex", unstack scalars(N chi2 p ll) ///
 replace  ///
 b(3) se(3) nomtitle label star(* 0.10 ** 0.05 *** 0.01) ///
 booktabs  ///
 title("Excluding smaller campaigns")
 

*===============================================================================    
* Table A6: Excluding campaigns with minor goals
*===============================================================================
* exclude greater autonomy, institutional change, policy reform
est clear

eststo: logit bi_internal_confl c.divsum##c.camp_age i.prim_meth c.lntotal_part i.sec_defect  c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur c.csorepress c.v2cacamps_ord c.v2pepwrses_ord if camp_goals != 1 | camp_goals != 2 | camp_goals != 4, vce(robust)

eststo: logit success c.divsum##c.camp_age i.prim_meth c.lntotal_part i.sec_defect  c.v2x_regime3 c.lngdppc c.lnpop c.ln_regdur c.csorepress c.v2cacamps_ord c.v2pepwrses_ord if camp_goals != 1 | camp_goals != 2 | camp_goals != 4, vce(robust)

esttab using "./subset_exc_minor.tex", unstack scalars(N chi2 p ll) ///
 replace  ///
 b(3) se(3) nomtitle label star(* 0.10 ** 0.05 *** 0.01) ///
 booktabs  ///
 title("Excluding campaigns with 'minor' goals")
 

